package com.canto.wanna.user.controller;

import com.canto.SpringContextUtil;
import com.canto.access.config.AccessConfig;
import com.canto.common.controller.BaseController;
import com.canto.common.utils.IDUtils;
import com.canto.common.utils.JsonUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/")
public class HelloController extends BaseController {


    @ResponseBody
    @RequestMapping(value = {"", "index"})
    public String index() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("hello world");
        buffer.append(IDUtils.nextSnowId());
        buffer.append("<br>");
        buffer.append(IDUtils.nextSnowId());
        buffer.append("<br>");
        AccessConfig accessConfig = SpringContextUtil.getBean(AccessConfig.class);
        buffer.append(JsonUtil.toObject(accessConfig.getMappingConfig().getIgnoreUrls()));
        return buffer.toString();
    }

    @RequestMapping("login")
    public String login() {
        return "content/login/login";
    }

}
